Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hogql): Add modifiers to query tags #21112

Merged
merged 1 commit into from
Mar 25, 2024
Merged

Conversation

tkaemming
Copy link
Contributor

Problem

We're going to want to test some additional variations of v3 overrides (#21059) with various modifiers, as well as comparing the performance of v3 against other PoE and non-PoE variations of similar queries. Having these values logged to the query log will make it easier to look at performance impacts over a larger sample than just single spot-checked queries.

Changes

Adds modifiers to query tags so that they are avaiable in the system.query_log.log_comment field.

Does this work well for both Cloud and self-hosted?

Yes.

How did you test this code?

These paths are already generally covered.

I don't think this is important enough to really need a test, but I did verify manually that it works:

ted@revuelto posthog % docker-compose -f docker-compose.dev.yml exec -it clickhouse clickhouse-client -q "select JSONExtractRaw(log_comment, 'modifiers') as modifiers from system.query_log where not empty(modifiers) order by event_time desc limit 10"
{"materializationMode":"auto"}
{"materializationMode":"disabled"}
{"materializationMode":"legacy_null_as_null"}
{"materializationMode":"legacy_null_as_null"}
{"materializationMode":"legacy_null_as_null"}
{"materializationMode":"legacy_null_as_null"}
{"materializationMode":"auto"}
{"materializationMode":"legacy_null_as_string"}
{"materializationMode":"legacy_null_as_string"}
{"materializationMode":"disabled"}

This comment was marked as off-topic.

@tkaemming tkaemming force-pushed the hogql-modifier-query-tag branch from 6135c70 to 6b7ff2e Compare March 22, 2024 20:12
@tkaemming tkaemming changed the title feat(hogl): Add modifiers to query tags feat(hogql): Add modifiers to query tags Mar 22, 2024
@tkaemming tkaemming marked this pull request as ready for review March 22, 2024 21:16
@tkaemming tkaemming requested a review from mariusandra March 22, 2024 21:16
@tkaemming tkaemming merged commit 3385d12 into master Mar 25, 2024
90 checks passed
@tkaemming tkaemming deleted the hogql-modifier-query-tag branch March 25, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants